import { RouterProvider } from "react-router-dom";
import { useDispatch } from 'react-redux'
import React, {useEffect} from "react";
import router from './router'
import { messageInfo } from './utils/message'
import  { getLocationInfo }  from './utils'
import { setLocation } from './store/reducers/app'
function App() {
  const dispatch = useDispatch()
  useEffect(() => {
      window.$message = messageInfo
      getLocationInfo().then(result => {
          dispatch(setLocation(result))
      })
  },[])
  return (
    <div className="App">
      <RouterProvider router={router} />
    </div>
  );
}

export default App;
